package com.wonders.qxmanager.service.impl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.hibernate.Criteria;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wonders.qxmanager.base.Parameter;
import com.wonders.qxmanager.base.WidgetPage;
import com.wonders.qxmanager.dao.UserDao;
import com.wonders.qxmanager.model.User;
import com.wonders.qxmanager.service.UserService;
import com.wonders.qxmanager.utils.PageArrayList;

/**
 * liubiao
 */

@Service
@Transactional
public class UserServiceImpl implements UserService {
	@Autowired
	private UserDao userDao;

	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}

	@Override
	public void deleteUser(BigDecimal id) {
		userDao.deleteUser(id);
	}

	@Override
	public int updateUser(String sqlString, Parameter parameter) {
		return userDao.update(sqlString, parameter);
	}

	@Override
	public PageArrayList<User> getListByPage(User user, WidgetPage page) {
		return userDao.getListByPage(user, page);
	}

	@Override
	public List<User> getAll() {
		return userDao.getAll();
	}

	@Override
	public User getUserById(BigDecimal id) {
		return userDao.getUserById(id);
	}

	@Override
	public List<User> getListByHQL(String sqlString, Parameter parameter) {
		return userDao.getListByHQL(sqlString, parameter);
	}

	@Override
	public User getUserByHQL(String hqlString, Parameter parameter) {
		return userDao.getByHQL(hqlString, parameter);
	}

}
